﻿<!--
Majesty of Omega - The next evolution of macro management space strategy

Copyright 2007 André Claaßen

This file is protected by the terms and conditions of the
Microsoft Community License (Ms-CL 1.1), a copy of which should
have been distributed along with this software. If not,
you may find the license information at the following URL:

http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx
-->

<!-- The Planet Detail Page

Note: The DataContext for the whole Page is the planet. 
      The Bindings are a path to the Properties of the Planet
-->
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Controls="clr-namespace:Majesty_of_Omega.GUI.Controls"
    xmlns:Majesty_of_Omega_GUI="clr-namespace:Majesty_of_Omega.GUI"
    xmlns:PageStarSystemObjects="clr-namespace:Majesty_of_Omega.GUI.Pages.Game.PageStarSystemObjects;assembly="
    xmlns:Parts="clr-namespace:Majesty_of_Omega.GUI.Pages.Game.Parts;assembly=" 
    x:Class="Majesty_of_Omega.GUI.Pages.Game.PlanetDetailPage"
    Title="PlanetDetailPage"
    Background="{DynamicResource PlanetStdBackground}"
    DataContext="{Binding Source={StaticResource MooGame}, Path=DemoPlanet}"
    >

    <Page.Triggers>
        <!-- Page Load Animation to move the planets in the upper left corner -->
        <EventTrigger RoutedEvent="Page.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation From="1.0" To="0.0" Duration="0:0:1"
                           Storyboard.TargetName="MyStarSystem2d"
                           Storyboard.TargetProperty="PlanetRelativeAngle" />
                    <DoubleAnimation From="1.0" To="0.4" Duration="0:0:1"
                           Storyboard.TargetName="MyStarSystem2d"
                           Storyboard.TargetProperty="Scale" />
                    <DoubleAnimation From="0.0" To="100.0" Duration="0:0:1"
                           Storyboard.TargetName="MyStarSystem2d"
                           Storyboard.TargetProperty="StarSystemCenterY" />
                    <DoubleAnimation  From="0" To="2880" Duration="0:6:0" AutoReverse="False"
                            RepeatBehavior="Forever"
                            Storyboard.TargetName="MyStarSystem2d"
                            Storyboard.TargetProperty="SystemRotation" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Page.Triggers>

    <Grid x:Name="MainGrid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="290" />
            <ColumnDefinition Width="0.165*" />
            <ColumnDefinition Width="0.364*"/>
            <ColumnDefinition Width="0.471*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.344*" />
            <RowDefinition Height="0.656*" />
        </Grid.RowDefinitions>

        <!-- This is the star system whith the sun and all planets. 
         Note: The DataContext of the StarSystem2D is bound with the parent star of the Planet
    -->
        <PageStarSystemObjects:StarSystem2D
          x:Name="MyStarSystem2d"
          ShowOrbitalRings="False"
          ShowInfoText="False"
          VerticalAlignment="Top"
          Star="{Binding Path=Star}"
          IsStarSelectable="False" 
          SelectedOrbital="{Binding}" 
          Margin="0,-4,0,0"
          />

        <!-- Sample picture from the original master of orion III -->
        <!--<Image Margin="40.209,-568.042,472.391,0" VerticalAlignment="Top" Source="..\Images\2007-05-16 MOO EconoPages.PNG" d:LayoutOverrides="VerticalAlignment" Height="336.042" Grid.Column="1" Grid.ColumnSpan="3"/>-->

        <!-- EconoPages Panel -->
        <Parts:EconomicPanelPart Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="2" />

        <!-- Stack with serveral Panels -->
        <StackPanel VerticalAlignment="Bottom" Grid.Column="3" Grid.Row="0" x:Name="PanelCondition" HorizontalAlignment="Stretch" Grid.RowSpan="2">
            <Controls:Panel Title="Military" x:Name="SubPanelMilitary" MinWidth="0" >
                <StackPanel/>
            </Controls:Panel>
            <Controls:Panel Title="Demographics" x:Name="SubPanelDemographics" MinWidth="0" >
                <StackPanel/>
            </Controls:Panel>
            <Controls:Panel Title="Environment" x:Name="SubPanelEnvironment" Width="Auto" Height="Auto" MinWidth="0" >
                <Grid Background="{DynamicResource PanelBackgroundBrush}" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.492*"/>
                        <ColumnDefinition Width="Auto" MinWidth="107.45"/>
                        <ColumnDefinition Width="0.508*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.162*"/>
                        <RowDefinition Height="0.571*"/>
                        <RowDefinition Height="0.267*"/>
                    </Grid.RowDefinitions>
                    <Border Grid.Column="1" Background="#FFFD0707" Width="100" Height="100">
                        <Grid Width="Auto" Height="Auto">
                            <Ellipse>
                                <Ellipse.Fill>
                                    <RadialGradientBrush>
                                        <GradientStop Color="#FFFFFFFF" Offset="0.005"/>
                                        <GradientStop Color="#FFC80404" Offset="1"/>
                                        <GradientStop Color="#FE0F7E02" Offset="0.207"/>
                                        <GradientStop Color="#FE44DA06" Offset="0.458"/>
                                        <GradientStop Color="#FEEFE906" Offset="0.618"/>
                                        <GradientStop Color="#FEE16600" Offset="0.801"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse Fill="#FF000000" Stroke="#FF000000" Margin="45.382,47,44.618,43"/>
                        </Grid>
                    </Border>
                </Grid>
            </Controls:Panel>

            <Controls:Panel Title="Planet Infrastructure" Height="Auto" x:Name="SubPanelInfrastructure" Width="Auto" MinWidth="0" >
                <StackPanel>
                    <Expander Header="Planetary Policies" IsExpanded="True" ExpandDirection="Down" Width="Auto">
                        <Grid Background="{DynamicResource PanelBackgroundBrush}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0.372*"/>
                                <ColumnDefinition Width="0.556*"/>
                                <ColumnDefinition Width="0.072*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Label Content="Classification I" VerticalAlignment="Center" />
                            <ComboBox HorizontalAlignment="Stretch" Grid.Column="1" IsSynchronizedWithCurrentItem="True" VerticalAlignment="Center" />
                            <CheckBox Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" />
                            <Label Content="Classification II" Grid.Row="1" VerticalAlignment="Center"/>
                            <ComboBox HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="1" IsSynchronizedWithCurrentItem="True" VerticalAlignment="Center" />
                            <CheckBox Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" />
                            <Label Content="Regional Zoning" Grid.Row="2" VerticalAlignment="Center"/>
                            <ComboBox HorizontalAlignment="Stretch" Grid.Row="2" Grid.Column="1" IsSynchronizedWithCurrentItem="True" VerticalAlignment="Center" />
                            <CheckBox Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Grid>
                    </Expander>
                    <Expander Header="Planetary Structures" Width="Auto">
                        <Grid Height="108" Background="{DynamicResource PanelBackgroundBrush}">
                            <TreeView/>
                        </Grid>
                    </Expander>
                </StackPanel>
            </Controls:Panel>
        </StackPanel>

        <!-- Large left panel with the regions of the planet  -->
        <ListBox HorizontalAlignment="Stretch"
             VerticalAlignment="Bottom"
             x:Name="RegionsList"
             Grid.Row="0" Grid.RowSpan="2"
             MaxHeight="600" 
             ItemsSource ="{Binding Path=Regions}"
             Background="{DynamicResource PanelBackgroundBrush}" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Grid.IsSharedSizeScope="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ListBox.ItemTemplate>
                <DataTemplate >
                    <Parts:RegionItemPart  Width="290" HorizontalAlignment="Stretch" Region="{Binding}" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <!-- Upper panel with the planet informations  -->
        <Majesty_of_Omega_GUI:PlanetarySummary HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="1" Grid.ColumnSpan="3"/>
        <Frame Source=".\RegionDetailPage.xaml" Margin="352,39.707,52.419,0" Background="#FFF7F0F0" VerticalAlignment="Top" Height="232.293" Grid.ColumnSpan="3" NavigationUIVisibility="Hidden" Visibility="Hidden"/>
    </Grid>
</Page>
